package org.opens.sql.constant;

public enum IdType {

    MYSQL_AUTO_INCREMENT("MYSQL_AUTO_INCREMENT", "mysql自增主键"),
    INPUT("INPUT", "手动写入"),
    ORACLE_SYS_GUID("ORACLE_SYS_GUID", "oracle的sys_guid()函数产生主键"),
    ORACLE_SEQUENCE("ORACLE_SEQUENCE", "oracle的序列产生主键");

    private String value;

    private String desc;

    IdType(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public IdType getInstance(String value) {
        for (IdType idType : IdType.values()) {
            if (idType.value.equals(value)) {
                return idType;
            }
        }
        return null;
    }

}
